<?php
require_once 'includes/functions.php';
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>九恩科技</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f8f9fa;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 600px;
            background: white;
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        h1 {
            color: #2c3e50;
            margin-bottom: 20px;
            font-size: 2em;
        }

        p {
            color: #666;
            margin-bottom: 30px;
            font-size: 1.1em;
        }

        .btn {
            display: inline-block;
            padding: 12px 24px;
            background-color: #3498db;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            font-weight: bold;
            transition: background-color 0.3s;
        }

        .btn:hover {
            background-color: #2980b9;
        }

        @media (max-width: 480px) {
            .container {
                padding: 20px;
            }

            h1 {
                font-size: 1.5em;
            }

            p {
                font-size: 1em;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>九恩科技</h1>
        <p>如果您是管理员，请登录管理后台。</p>
        <?php if (isset($_GET['error'])): ?>
            <div style="color: #dc3545; margin-bottom: 15px;">用户名或密码错误</div>
        <?php endif; ?>
        <?php if (!is_logged_in()): ?>
        <form action="/admin/login.php" method="post" style="max-width: 300px; margin: 0 auto;">
            <div style="margin-bottom: 15px;">
                <input type="text" name="username" placeholder="用户名" required 
                       style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
            </div>
            <div style="margin-bottom: 15px;">
                <input type="password" name="password" placeholder="密码" required
                       style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;">
            </div>
            <button type="submit" class="btn">管理员登录</button>
        </form>
        <?php else: ?>
        <a href="/admin/" class="btn">进入管理后台</a>
        <?php endif; ?>
    </div>
</body>
</html>
